home *** CD-ROM | disk | FTP | other *** search
- on oldfindScroll
- global gSearchTextCast, gFindText
-
- -- is gFindText void
- if not ( voidP(gFindText) ) then
- -- not void, so look in search text for passed string
- if not ( gFindText = "" ) then
- set gSearchText = gSearchTextCast
- --set the scrollTop of member gSearchText = 0
- set thisField = the text of cast gSearchText of castLib "Shared"
- set lineExit = FALSE
- -- count total words in cast member
- set numLines = the number of lines in thisField
- set posnChar = 0
- repeat with i=1 to numLines
- -- count total words in cast member
- set numWords = the number of words in line i of thisField
- -- loop across all words
- repeat with j=1 to numWords
- -- see if this word matches the find word, case-insensitive
- if (word j of line i of thisField = gFindText) then
- -- make sure the second characters are both case-identical
- if (charToNum(char 2 of word j of line i of thisField) = ¬
- charToNum(char 2 of gFindText)) then
- --alert "EXACT search hit at" && value(j) && "," && value(i) && ¬
- -- word j of line i of thisField
- if (posnChar = 0) then
- set the scrollTop of member gSearchText = 0
- else if (posnChar > 0) then
- nothing
- set the scrollTop of member gSearchText of¬
- castLib "Shared" = value(item 2 of (string( ¬
- charPosToLoc(member gSearchText, posnChar))))
- end if
- -- last word in loop
- set lineExit = TRUE
- exit repeat
- end if
- end if
- end repeat -- words in line
- if ( lineExit ) then
- -- last line in loop
- exit repeat
- end if
- set posnChar = posnChar + the number of chars in line i of thisField + 1
- end repeat -- lines in text
- end if
- else
- -- void, so do not look
- nothing
- end if
- end oldfindScroll
-